<script>
export default {
    name: "MyCart"
}
</script>
<template>
    <div>
        <h3 v-if="$store.state.cart.cartList.length===0">
            购物车空空如也！
        </h3>
        <template v-else>
            <div v-for="item in $store.state.cart.cartList" :key="item.goodsId">
                <p>商品名称：{{item.goodsName}}</p>
                <p>商品价格：{{item.goodsPrice | currency}}</p>
                <p>购买数量：{{item.buyNum}}</p>
                <hr/>
            </div>
            <h3>合计:{{$store.getters.sumPrice | currency}}</h3>
        </template>


    </div>
</template>

<style scoped>

</style>